import request from '@/request/request'

// 获取转账单列表
export function getTransferOrderList(params) {
  return request({
    url: '/finance/transferOrder/list',
    method: 'get',
    params
  })
}

// 获取转账单详情
export function getTransferOrderDetail(id) {
  return request({
    url: `/finance/transferOrder/detail/${id}`,
    method: 'get'
  })
}

// 新增转账单
export function addTransferOrder(data) {
  return request({
    url: '/finance/transferOrder/add',
    method: 'post',
    data
  })
}

// 修改转账单
export function updateTransferOrder(data) {
  return request({
    url: '/finance/transferOrder/update',
    method: 'put',
    data
  })
}

// 删除转账单
export function deleteTransferOrder(id) {
  return request({
    url: `/finance/transferOrder/delete/${id}`,
    method: 'delete'
  })
}

// 批量删除转账单
export function batchDeleteTransferOrder(ids) {
  return request({
    url: '/finance/transferOrder/batchDelete',
    method: 'delete',
    data: ids
  })
}

// 审核转账单
export function approveTransferOrder(id) {
  return request({
    url: `/finance/transferOrder/approve/${id}`,
    method: 'put'
  })
}

// 批量审核转账单
export function batchApproveTransferOrder(ids) {
  return request({
    url: '/finance/transferOrder/batchApprove',
    method: 'put',
    data: { ids }
  })
}

// 导出转账单
export function exportTransferOrder(params) {
  return request({
    url: '/finance/transferOrder/export',
    method: 'get',
    params,
    responseType: 'blob'
  })
}

// 获取转账单统计
export function getTransferOrderStats(params) {
  return request({
    url: '/finance/transferOrder/stats',
    method: 'get',
    params
  })
} 